<?php

namespace App\Transformers\Shipping;

use App\Models\Express;
use League\Fractal\TransformerAbstract;

class ExpressTransformer extends TransformerAbstract
{
    public function transform(Express $data){
        return [
            'id' => $data->id,
            'code' => $data->code ?? '',
            'name' => $data->name ?? '',
            'account' => $data->account ?? '',
            'net_name' => $data->net_name ?? '',
            'sort' => $data->sort ?? '',
            'partner_id' => $data->partner_id ?? '',
            'is_net' => $data->is_net ?? '',
            'is_show' => $data->is_show ?? '',
            'status' => $data->status ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }

}
